Conversation
alternate take on #8487 ### Change type - [ ] `bugfix` - [ ] `improvement` - [ ] `feature` - [ ] `api` - [x] `other`
I spoke with @fat from pierre and agreed to a 10% trial of production traffic so we could get a sense of how much space we'd consume as well as what kind of write throughput we'd expect to see. For throughput I added a workers analytics event to track the number of bytes written in incremental writes. Then we can sum all the events in grafana and multiply by 10 to get a realistic view of write throughput. For disk space consumption I'll be running some separate tests using staging R2 snapshot data to 'migrate' existing rooms to pierre to get a sense of what kind of compression factor it offers (i think it'll be logarithmic and dependent on usage patterns), and then we can try to apply that to the production R2 bucket to get a good sense of how much space we'd be using. ### Change type - [x] `other`
In order to prevent a context menu from briefly flashing when right-clicking to dismiss an already-open context menu, this PR intercepts the browser's `contextmenu` event before it can reach the Radix Trigger. Closes #8479 Closes #8251 **Root cause:** When a menu is open, `MenuClickCapture` overlays the canvas. On right-click, `handlePointerDown` calls `clearOpenMenus()`, which triggers a synchronous render that unmounts `MenuClickCapture` itself. The browser's `contextmenu` event — which fires after `pointerdown` — then passes through to the Radix `ContextMenu.Trigger` unopposed, briefly opening a new context menu. Radix's `DismissableLayer` immediately detects the pointer is outside and dismisses it, producing a visible flash. **Fix:** Before calling `clearOpenMenus()`, register a one-shot capture-phase `contextmenu` listener on the document that swallows the event with `stopImmediatePropagation()`. This prevents the event from ever reaching Radix. The listener auto-removes via `{ once: true }`. A React `onContextMenu` handler is also added to `MenuClickCapture` as a belt-and-suspenders guard for cases where the component hasn't unmounted yet. ### Change type - [x] `bugfix` ### Test plan 1. Right-click on the canvas — context menu appears 2. Right-click elsewhere on the canvas — context menu dismisses cleanly, no flash 3. Repeat rapidly — no flash on any consecutive right-click 4. Right-click on a shape — context menu shows shape actions 5. Open a dropdown/toolbar menu, then right-click on canvas — dropdown dismisses, no flash 6. Left-click or press Escape to dismiss context menu — still works as before 7. Long-press on touch device — context menu still works (fix only targets button 2) - [ ] Unit tests - [ ] End to end tests ### Release notes - Fix context menu briefly flashing when right-clicking to dismiss an already-open context menu. ### Code changes | Section | LOC change | | ---------- | ---------- | | Core code | +20 / -0 | Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ems (#8499) When right-clicking to open a context menu and moving the mouse quickly, the `pointerup` (button 2) from the right-click can land on a menu item and trigger selection without the user intending to click it. Closes #8480 **Root cause:** Radix's `MenuItem` calls `event.currentTarget.click()` on `pointerup` when `isPointerDownRef` is false (i.e. the pointer wasn't pressed down on that item). This is intentional for drag-to-select behavior, but it doesn't check the pointer button — so a right-click release (button 2) triggers the same path as a left-click release. **Fix:** Add an `onPointerUp` handler to `_ContextMenu.Item` that calls `preventDefault()` for non-left-click buttons. Radix's `composeEventHandlers` runs the user handler first and skips its internal handler when `defaultPrevented` is true, so the synthetic `click()` never fires. ### Change type - [x] `bugfix` ### Test plan 1. Right-click on empty canvas — context menu appears 2. Move mouse quickly across menu items — no item should activate 3. Right-click on a shape, move fast across items — no item should activate 4. Left-click a menu item normally — should still work 5. Drag from outside the menu onto an item and release (left button) — should still select - [ ] Unit tests - [ ] End to end tests ### Release notes - Fix context menu items being accidentally selected when right-clicking and quickly moving the mouse. ### Code changes | Section | LOC change | | ---------- | ---------- | | Core code | +9 / -0 | Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )